package com.hjm.admin.moule.view.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hjm.admin.moule.R;
import com.hjm.admin.moule.model.MainMenuBean;
import com.hjm.admin.moule.utils.DimenUtils;

import java.util.List;

public class MainMenuAdapter extends BaseQuickAdapter<MainMenuBean, BaseViewHolder> {

    public MainMenuAdapter(@Nullable List<MainMenuBean> data) {
        super(R.layout.adapter_main_menu, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MainMenuBean item) {
        TextView name = helper.getView(R.id.tv_name);
        name.setText(item.getName());
        AppCompatImageView iv_icon = helper.getView(R.id.iv_icon);
        iv_icon.setImageResource(item.getIcon());
    }
}
